/**
 *
 */
package com.zhuoyue.elmt.entity;

import com.eit.eitsite.modules.sys.entity.Menu;
import com.eit.eitsite.modules.sys.entity.Office;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;

import com.eit.eitsite.common.persistence.DataEntity;

import java.util.List;

/**
 * 设备分组Entity
 *
 * @author JiangYH
 * @version 2017-02-09
 */
public class XtPq extends DataEntity<XtPq> {

    private static final long serialVersionUID = 1L;
    private String name;        // 名称
    private String type;        // 分组方式
    private String chooseType; // 选择方式
    private String remark;        // 备注
    private String maintenUnitCode;        // 维保单位代码

    private String pqId;        // 组ID
    private String wbdwdm;		// 维保单位代码
    private String wbdwmc;		// 维保单位名称
    private String sbzcdm;		// 设备注册代码
    private String sbpzmc;		// 设备品种名称
    private List<XtPqxqgx> xqList = Lists.newArrayList(); // 辖区
    private List<XtPqxqgx> groupList = Lists.newArrayList(); // 分组
    private List<XtPqxqgx> staffList = Lists.newArrayList(); // 人员
    private List<XtPqxqgx> sbList = Lists.newArrayList(); // 设备

    public XtPq() {
        super();
    }

    public XtPq(String id) {
        super(id);
    }

    @Length(min = 0, max = 200, message = "名称长度必须介于 0 和 200 之间")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Length(min = 0, max = 10, message = "分组方式长度必须介于 0 和 10 之间")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Length(min = 0, max = 10, message = "选择方式长度必须介于 0 和 10 之间")
    public String getChooseType() {
        return chooseType;
    }

    public void setChooseType(String chooseType) {
        this.chooseType = chooseType;
    }

    @Length(min = 0, max = 100, message = "备注长度必须介于 0 和 100 之间")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Length(min = 0, max = 100, message = "维保单位代码长度必须介于 0 和 100 之间")
    public String getMaintenUnitCode() {
        return maintenUnitCode;
    }

    public void setMaintenUnitCode(String maintenUnitCode) {
        this.maintenUnitCode = maintenUnitCode;
    }

    public List<XtPqxqgx> getXqList() {
        return xqList;
    }

    public void setXqList(List<XtPqxqgx> xqList) {
        this.xqList = xqList;
    }

    public List<String> getXqIdList() {
        List<String> xqIdList = Lists.newArrayList();
        for (XtPqxqgx xtPqxqgx : xqList) {
            xqIdList.add(xtPqxqgx.getXqId());
        }
        return xqIdList;
    }

    public void setXqIdList(List<String> xqIdList) {
        xqList = Lists.newArrayList();
        for (String id : xqIdList) {
            XtPqxqgx xtPqxqgx = new XtPqxqgx();
            xtPqxqgx.setXqId(id);
            xqList.add(xtPqxqgx);
        }
    }

    public String getXqIds() {
        return StringUtils.join(getXqIdList(), ",");
    }

    public void setXqIds(String xqIds) {
        xqList = Lists.newArrayList();
        if (xqIds != null) {
            String[] ids = StringUtils.split(xqIds, ",");
            setXqIdList(Lists.newArrayList(ids));
        }
    }

    public List<XtPqxqgx> getStaffList() {
        return staffList;
    }

    public void setStaffList(List<XtPqxqgx> staffList) {
        this.staffList = staffList;
    }

    public List<String> getStaffIdList() {
        List<String> staffIdList = Lists.newArrayList();
        for (XtPqxqgx xtPqxqgx : staffList) {
            staffIdList.add(xtPqxqgx.getStaffId());
        }
        return staffIdList;
    }

    public void setStaffIdList(List<String> staffIdList) {
        staffList = Lists.newArrayList();
        for (String id : staffIdList) {
            XtPqxqgx xtPqxqgx = new XtPqxqgx();
            xtPqxqgx.setStaffId(id);
            staffList.add(xtPqxqgx);
        }
    }

    public String getStaffIds() {
        return StringUtils.join(getStaffIdList(), ",");
    }

    public void setStaffIds(String staffIds) {
        staffList = Lists.newArrayList();
        if (staffIds != null) {
            String[] ids = StringUtils.split(staffIds, ",");
            setStaffIdList(Lists.newArrayList(ids));
        }
    }

    public List<XtPqxqgx> getSbList() {
        return sbList;
    }

    public void setSbList(List<XtPqxqgx> sbList) {
        this.staffList = staffList;
    }

    public List<String> getSbIdList() {
        List<String> sbIdList = Lists.newArrayList();
        for (XtPqxqgx xtPqxqgx : sbList) {
            sbIdList.add(xtPqxqgx.getSbId());
        }
        return sbIdList;
    }

    public void setSbIdList(List<String> sbIdList) {
        sbList = Lists.newArrayList();
        for (String id : sbIdList) {
            XtPqxqgx xtPqxqgx = new XtPqxqgx();
            xtPqxqgx.setSbId(id);
            sbList.add(xtPqxqgx);
        }
    }

    public String getSbIds() {
        return StringUtils.join(getSbIdList(), ",");
    }

    public void setSbIds(String sbIds) {
        sbList = Lists.newArrayList();
        if (sbIds != null) {
            String[] ids = StringUtils.split(sbIds, ",");
            setSbIdList(Lists.newArrayList(ids));
        }
    }

    public List<XtPqxqgx> getGroupList() {
        return groupList;
    }

    public void setGroupList(List<XtPqxqgx> groupList) {
        this.groupList = groupList;
    }

    public List<String> getGroupIdList() {
        List<String> groupIdList = Lists.newArrayList();
        for (XtPqxqgx xtPqxqgx : groupList) {
            groupIdList.add(xtPqxqgx.getGroupId());
        }
        return groupIdList;
    }

    public void setGroupIdList(List<String> groupIdList) {
        groupList = Lists.newArrayList();
        for (String id : groupIdList) {
            XtPqxqgx xtPqxqgx = new XtPqxqgx();
            xtPqxqgx.setGroupId(id);
            groupList.add(xtPqxqgx);
        }
    }

    public String getGroupIds() {
        return StringUtils.join(getGroupIdList(), ",");
    }

    public void setGroupIds(String groupIds) {
        groupList = Lists.newArrayList();
        if (groupIds != null) {
            String[] ids = StringUtils.split(groupIds, ",");
            setGroupIdList(Lists.newArrayList(ids));
        }
    }

    public String getPqId() {
        return pqId;
    }

    public void setPqId(String pqId) {
        this.pqId = pqId;
    }

    public String getWbdwdm() {
        return wbdwdm;
    }

    public void setWbdwdm(String wbdwdm) {
        this.wbdwdm = wbdwdm;
    }

    public String getWbdwmc() {
        return wbdwmc;
    }

    public void setWbdwmc(String wbdwmc) {
        this.wbdwmc = wbdwmc;
    }

    public String getSbzcdm() {
        return sbzcdm;
    }


    public void setSbzcdm(String sbzcdm) {
        this.sbzcdm = sbzcdm;
    }

    public String getSbpzmc() {
        return sbpzmc;
    }
    public void setSbpzmc(String sbpzmc) {
        this.sbpzmc = sbpzmc;
    }
}